var NetHttp =
{
    login: function (account, password) {
        return NetUtil.httpPost("/user/login", {
            acct: account,
            pwd: md5(password)
        })
    },
    loginByToken: function (uid) {
        return axios.post(appConfig.webAddr + "/user/login/token", {
            token: UserInfo.getInstance().getToken(),
            uid: uid
        })
    },
    register: function (phone, password, nickname, code) {
        NetUtil.get("/weixin/dkReg", {
            phone: phone,
            password: md5(password),
            nickname: nickname,
            phoneCode: code,
            invitecode: 0,
            sex: 0,
        }, function (suc, res) {
            if (res && res.code == 200) {
                console.log("注册成功");
                Tip.instance().show('注册成功');
            } else {
                var str = "注册失败 " + res.msg;
                console.log(str);
                Tip.instance().show("注册失败," + res.msg);
            }
        });
    },
    getCode: function (mobile, countryCode) {
        return NetUtil.httpPost("/user/pwd/modify/code/get", {
            mobile: mobile,
            countryCode: countryCode
        });
    },
    reset: function (mobile, pwd, code) {
        return NetUtil.httpPost("/user/pwd/modify/code", {
            mobile: mobile,
            pwd: md5(pwd),
            code: code
        });
    },
    changePwd: function (prePwd, newPwd) {
        return NetUtil.httpPost("/auth/user/pwd/modify", {
            token: userInfo.getToken(),
            prePwd: md5(prePwd),
            newPwd: md5(newPwd)
        });
    },
    /*
    typePlace  0 北京玩法 1 江苏 2 全部
    typeAward   0 中奖 1 未中奖 2 全部
    page    页数
     */
    getBetRecord: function (typePlace, typeAward, page) {
        console.log(typePlace, typeAward, page)
        return NetUtil.httpPost("/auth/user/getMyK3Record", {
            token: UserInfo.getInstance().getToken(),
            typePlace: typePlace,
            typeAward: typeAward,
            page: page,
        });
    },

}